package com.singfan.common.nosql.mongo.provider;

import com.singfan.common.ServerEnv;

/**
 * Author: hansonghe
 * Date: 2015-08-21 09:57
 * Desc:
 */
public class SimpleMongoConfigProvider extends MongoConfigProvider {
    private String host;
    private int port;
    @Override
    public void init() {
        if (ServerEnv.isRelease()){
            host = "127.0.0.1";
            port = 27017;
        }
        else if ("test".equals(ServerEnv.getEnv())){
            host = "127.0.0.1";
            port = 27017;
        }
        else {
            host = "127.0.0.1";
            port = 27017;
        }
    }

    @Override
    public String getHost() {
        return host;
    }

    @Override
    public int getPort() {
        return port;
    }
}
